﻿function fnShowMarker() {
    var w = $(document).width();
    var h = $(document).height();
    var divMark = $('#divMarker');
    divMark.width(w);
    divMark.height(h);
    divMark.show();

    var divMaxChart = $('#divMaxChart');
    divMaxChart.width(w - 60);
    divMaxChart.height(h - 40);
    divMaxChart.css('left', 30);
    divMaxChart.css('top', 20);

    return divMaxChart;
}

function fnMaxChart(chartType, chartXML, width, height, isEmptyData) {
    var chart = new FusionCharts('/PubProject/FusionCharts/' + chartType + '.swf', chartType, width, height, "0", "1", isEmptyData);
    chart.setDataXML(chartXML);
    chart.render("divMaxChartPanel");
}
//show maxmize chart
function fnShowMaxChart(iframeId, chartId, title, chartType, widthScale, heightScale) {
    var iframeWindow = document.getElementById(iframeId).contentWindow;
    var oChart = iframeWindow["chart_" + chartId];

    chartXML = oChart.variables.dataXML;
    $('#divAction').html(title);

    var width = $(document).width() - 70;
    var height = parseInt(width * heightScale / widthScale);

    var divMaxChart = fnShowMarker();
    divMaxChart.show('slow', function() {
        fnMaxChart(chartType, chartXML, width, height, oChart.isEmptyData);
    });
}

function fnClose() {
    $('#divAction').html('');
    $('#divMaxChart').hide('slow', function() {
        $('#divMaxChartPanel').html('');
        $('#divMarker').hide();
    });
}